package com.ruoyi.daily.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.daily.mapper.XinfengCustomerQuotationMapper;
import com.ruoyi.daily.domain.XinfengCustomerQuotation;
import com.ruoyi.daily.service.IXinfengCustomerQuotationService;

/**
 * 报价单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-21
 */
@Service
public class XinfengCustomerQuotationServiceImpl implements IXinfengCustomerQuotationService 
{
    @Autowired
    private XinfengCustomerQuotationMapper xinfengCustomerQuotationMapper;

    /**
     * 查询报价单
     * 
     * @param id 报价单主键
     * @return 报价单
     */
    @Override
    public XinfengCustomerQuotation selectXinfengCustomerQuotationById(Long id)
    {
        return xinfengCustomerQuotationMapper.selectXinfengCustomerQuotationById(id);
    }

    /**
     * 查询报价单列表
     * 
     * @param xinfengCustomerQuotation 报价单
     * @return 报价单
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<XinfengCustomerQuotation> selectXinfengCustomerQuotationList(XinfengCustomerQuotation xinfengCustomerQuotation)
    {
        return xinfengCustomerQuotationMapper.selectXinfengCustomerQuotationList(xinfengCustomerQuotation);
    }

    /**
     * 新增报价单
     * 
     * @param xinfengCustomerQuotation 报价单
     * @return 结果
     */
    @Override
    public int insertXinfengCustomerQuotation(XinfengCustomerQuotation xinfengCustomerQuotation)
    {
        xinfengCustomerQuotation.setCreateTime(DateUtils.getNowDate());
        return xinfengCustomerQuotationMapper.insertXinfengCustomerQuotation(xinfengCustomerQuotation);
    }

    /**
     * 修改报价单
     * 
     * @param xinfengCustomerQuotation 报价单
     * @return 结果
     */
    @Override
    public int updateXinfengCustomerQuotation(XinfengCustomerQuotation xinfengCustomerQuotation)
    {
        xinfengCustomerQuotation.setUpdateTime(DateUtils.getNowDate());
        return xinfengCustomerQuotationMapper.updateXinfengCustomerQuotation(xinfengCustomerQuotation);
    }

    /**
     * 批量删除报价单
     * 
     * @param ids 需要删除的报价单主键
     * @return 结果
     */
    @Override
    public int deleteXinfengCustomerQuotationByIds(Long[] ids)
    {
        return xinfengCustomerQuotationMapper.deleteXinfengCustomerQuotationByIds(ids);
    }

    /**
     * 删除报价单信息
     * 
     * @param id 报价单主键
     * @return 结果
     */
    @Override
    public int deleteXinfengCustomerQuotationById(Long id)
    {
        return xinfengCustomerQuotationMapper.deleteXinfengCustomerQuotationById(id);
    }
}
